package com.usian.service;

import com.usian.mapper.UsersMapper;
import com.usian.pojo.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UsersService {

    @Autowired
    private UsersMapper usersMapper;


    public void addUser(Users users) {
        usersMapper.insert(users);


    }

    public List<Users> listUser() {
        return usersMapper.selectAll();
    }

    public void deleteUser(Integer id) {
        usersMapper.deletes(id);
    }

    public Users toupdate(Integer id) {
      return   usersMapper.selectByid(id);

    }
}
